"""
@filename: likeapi.py
@project: flask_project
@author: wlf
@time: 2022-09-07
点赞表
"""
from model import db
import datetime
from sqlalchemy import MetaData


class Like(db.Model):
    __tablename__ = "like"
    metadata = MetaData()
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
    post_id = db.Column(db.Integer, db.ForeignKey("posts.id"))
    CreatedAt = db.Column(db.DateTime, default=datetime.datetime.now())